package com.hqyj.javaGraduation.hotel.account.controller;

import com.hqyj.javaGraduation.hotel.account.pojo.AccountUser;
import com.hqyj.javaGraduation.hotel.account.service.AccountUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/account")
public class AccountUserController {
    @Autowired
    private AccountUserService accountUserService;

    /**
     * 127.0.0.1:8080/account/addUser ----get
     * @param accountUser
     * @return
     */
    @GetMapping(value = "addUser")
    public HashMap<String, Object> addAccountUser(AccountUser accountUser) {
        return accountUserService.addAccountUser(accountUser);
    }

    /**
     * 127.0.0.1:8080/account/updateUser ----get
     * @param accountUser
     * @return
     */
    @GetMapping(value = "updateUser")
    public HashMap<String, Object> updateAccountUser(AccountUser accountUser) {
        return accountUserService.updateAccountUser(accountUser);
    }

    /**
     * 127.0.0.1:8080/account/delUser ----get
     * @param id
     * @return
     */
    @GetMapping(value = "delUser")
    public HashMap<String, Object> delAccountUser(Integer id) {
        return accountUserService.delAccountUser(id);
    }
}
